// Package _1_DP 322
// @Title _1_DP
// @Description
// @Author  == 琳琳也叫王木木 ==  2021/9/27 11:24
// @Create  2021/9/27 11:24
package _1_DP

import "fmt"

func min(a, b int) int {
	if a > b {
		return b
	}
	return a
}

// 零钱兑换傻递归模式
func CoinChange(coins []int, amount int) int {
	fmt.Println(coins, amount)
	fmt.Println("递归结果", process(coins, amount, 0))
	return 0
}

func process(coins []int, amount, depth int) int {
	if amount == 0 {
		return depth
	}
	for i := 0; i < len(coins); i++ {
		if amount >= coins[i] {
			process(coins, amount-coins[i], depth+1)
		}
	}
	return -1
}
